{% comment %}<!--
Copyright (C) 2009 Attila-Mihaly Balazs

TwitFeeder is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

TwitFeeder is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU Affero General Public License
along with TwitFeeder.  If not, see <http://www.gnu.org/licenses/>
-->{% endcomment %}
{% extends "base.html" %}

{% block title %}{{ username }} - TwitFeeder{% endblock %}

{% block head %}
    <link rel="alternate" type="application/rss+xml" title="RSS Feed for {{ username }}" href="/feed/{{ uniqid }}/{{ base_url }}/{{ username|urlencode }}">
{% endblock %}

{% block content %}

<a href="/feed/{{ uniqid }}/{{ base_url }}/{{ username|urlencode }}">
    <img src="/static/feed-icon-32x32.png" width="32" height="32" style="vertical-align: bottom; border: none;" alt="">
</a>
RSS feed to subscribe to: 
<a href="/feed/{{ uniqid }}/{{ base_url }}/{{ username|urlencode }}">{{ root_url }}/feed/{{ uniqid }}/{{ base_url }}/{{ username|urlencode }}</a>

<br><br>

<form method="POST" action="/">
<p>
    <label for="username">Search for another user:</label>&nbsp;
    <input id="username" type="text" name="id">&nbsp;
    <button type="submit">Feed Me!</button>
</p>
</form>

<br>

{% if is_hashtag %}
<h1>
    On {{ username }} it was said:
</h1>
{% else %}
<h1>
    <a href="http://{{ base_url }}/{{ username }}"><img src="/avatar/{{ base_url }}/{{ username }}" alt="[ {{ username }}'s avatar ]" style="width: 1em; height: 1em; border: none;"></a>
    {{ username }} said:
</h1>
{% endif %}

<br>

<ul>
{% for entr in feed.statuses %}
    <li {% ifequal 1 forloop.counter %}class="firsttweet"{% endifequal %}>
        {% if is_hashtag %}
        <a href="http://{{ base_url }}/{{ username }}">
            <img src="/avatar/{{ base_url }}/{{ entr.user.screen_name }}" alt="[ {{ entr.user.screen_name }}'s avatar ]" style="width: 2em; height: 2em; border: none;">
            {{ entr.user.screen_name }}:
        </a>
        {% endif %}
        {{ entr.text }}<br>
        <span class="tweet_time_ago"><a href="{{ entr.link|escape }}">{{ entr.relative_created_at }}</a></span>
        {% if entr.geolink %}
        <span class="geolink"><a href="{{ entr.geolink|escape }}">
                <img src="{{ root_url }}/static/globe.png" width="16" height="16" alt="[ View status's geolocation ]"></a></span>
        {% endif %}
    </li>
{% endfor %}
</ul>
{% endblock %}

{% block validators %}
    <a href="http://validator.w3.org/feed/check.cgi?url={{ root_url|urlencode }}/feed/{{ uniqid }}/{{ base_url }}/{{ username|urlencode }}"><img src="/static/valid-rss.png" width="88" height="31" alt="[ Valid RSS ]"></a>
{% endblock %}